﻿@model HanGu.Entity.Advertisement
@{
    Layout = null;
    TempData["TitlePic"] = Model.FilePath;//.Replace("_B.", "_S.");
    var classTypeList = ViewData["ClassTypeList"] as SelectList;
    TempData["PhotoTip"] = "请上传图片：1000*255";
}
<div class="pageContent">
    <form method="post" action="admin/@ViewData["CurrentController"]/create" enctype="MULTIPART/FORM-DATA" class="pageForm required-validate"
    onsubmit="return iframeCallback(this, navTabAjaxDone);">
    <script>
        $(function () {
    $("#ClassType").val("@Session["classType"]");
    ShowPhotoTip("@Session["classType"]");
    });
    
    function ShowPhotoTip(val)
    {
    if(val==-1){
    $("#photoTip").html("请上传图片：185*60");
    }
    }
    </script>
    @Html.ValidationSummary(true)
    <div class="pageFormContent" layouth="56">
        @Html.HiddenFor(model => model.ID)
        <div class="CreateDiv">
            <div class="LeftDiv">
                <label>
                    预览图片：</label>
                @Html.HiddenFor(c => c.FilePath)
                @Html.Partial("uploadify")
            </div>
            <div class="rightDiv">
                <p>
                    <label>
                        模块分类：</label>
                    @Html.DropDownListFor(c => c.ClassType, classTypeList, new { @class = "combox", @onchange = "ShowPhotoTip($(this).val())" })
                </p>
                <p>
                    <label>
                        标题：</label>
                    @Html.TextBoxFor(model => model.Title, new {@style = "width:200px" })
                    @Html.ValidationMessageFor(model => model.Title)
                </p>
                <p>
                    <label>
                        URL：</label>
                    @Html.TextBoxFor(model => model.Url, new { @style = "width:200px" })
                    @Html.ValidationMessageFor(model => model.Url)
                </p>
                <p>
                    <label>
                        排序：</label>
                    @Html.TextBoxFor(model => model.Order, new { @class = "number" })
                    @Html.ValidationMessageFor(model => model.Order)
                </p>
                @*<p>
                    <label>
                        是否显示标题:</label>
                    <input type="checkbox" id="IsTitle" name="IsTitle"  checked="@Model.IsTitle"/>
                    @Html.ValidationMessageFor(model => model.IsTitle)
                </p>*@
                <p>
                    <label>
                        创建时间：</label>
                    @Html.TextBoxFor(model => model.CreateTime, new { @Readonly = "true" })
                    @Html.ValidationMessageFor(model => model.CreateTime)
                </p>
                <p>
                    <label>
                        创建者：</label>
                    @Html.TextBoxFor(model => model.Creator, new { @Readonly = "true" })
                    @Html.ValidationMessageFor(model => model.Creator)
                </p>
                <p>
                    <label>
                        修改时间：</label>
                    @Html.TextBoxFor(model => model.UpdateTime, new { @Readonly = "Readonly" })
                    @Html.ValidationMessageFor(model => model.UpdateTime)
                </p>
                <p>
                    <label>
                        修改者：</label>
                    @Html.TextBoxFor(model => model.Updater, new { @Readonly = "Readonly" })
                    @Html.ValidationMessageFor(model => model.Updater)
                </p>
            </div>
        </div>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit">
                            提交</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">
                            取消</button></div>
                </div>
            </li>
        </ul>
    </div>
    </form>
</div>
